-- CALC_RUBBISH_EVENT_BONUS

-- 捡垃圾奖励
-- @param bonus     奖励
return function(bonus)
    local dungeonId = DungeonM.getDungeonId();
    local layer = DungeonM.currentLayer();
    if dungeonId == 23 and layer == 1 then
        -- 军用铁锹,中毒
        return { ["bonus"] =  { 1, 7166, 1 }, ["status"] = {["status"] = 200, ["prop"] = {506,1,100,3,}, ["end_round"] = 3,}, };
    end

    -- TODO:
    if type(bonus) == 'table' and #bonus > 0 then
        -- 如果传入了配置的奖励，直接使用
        return { ["bonus"] = bonus, ["status"] = {["status"] = 200, ["prop"] = {506,1,100,3,}, ["end_round"] = 3,}, }
    end

    local rand = DungeonM.getRandSeed("rubbish_bonus") % 100;
    local rand2 = DungeonM.getRandSeed("rubbish_bonus");
    local ret = {};

    if rand < 40 then
        -- 40%概率：金币+50~500
        ret["bonus"] = { { 2, "money", 50 + rand2 % 451, }, };
    elseif rand < 80 then
        -- 40%概率：探索点+5~50
        ret["bonus"] = { { 2, "search_point", 5 + rand2 % 46, }, };
    else
        -- TODO: 20%概率：获得储物箱物品（概率等同查看储物箱）
        ret = FormulaM.invoke("CALC_STORAGE_BOX_BONUS", ME.user);
    end

    ret["status"] = {["status"] = 200, ["prop"] = {506,1,100,3,}, ["end_round"] = 3,}; -- 中毒3回合

    return ret;
end
